<?php
    /*include_once '../../../../controlador/php/conexion/Conexion.php';
    $con = new Conexion();
    
    $ingreso = $_REQUEST['ingreso'];
    $oidu = $_REQUEST['oidu'];
    
    $fecha1 = $_REQUEST['f1'];
    $fecha2 = $_REQUEST['f2'];
    
    $f1 = date('Y-m-d',strtotime($fecha1));
    $f2 = date('Y-m-d',strtotime($fecha2));
    
    $espe = "SELECT GENPACIEN.PACPRINOM + ' ' + GENPACIEN.PACSEGNOM + ' ' + GENPACIEN.PACPRIAPE + ' ' + GENPACIEN.PACSEGAPE AS nombres,
             GEEDESCRI,ltr_numSe,ltr_fecha,ltr_componente,case when controlTrans.con_oid is null then 'Signos no Registrados' else 'Signos vitales' end as signos
             FROM lTransfunc INNER JOIN DGempres10..GENESPECI ON lTransfunc.especialidad=DGempres10..GENESPECI.OID
                             INNER JOIN serviciosL ON lTransfunc.servicio=serviciosL.ser_oid
                             INNER JOIN DGempres10..GENPACIEN ON lTransfunc.genPacien=DGempres10..GENPACIEN.OID
                             left outer join controlTrans on lTransfunc.ltr_oid = controlTrans.ltr_oid
             WHERE ltr_fecha between '".$f1."' and '".$f2."' and adnIngreso = ".$ingreso." AND servicio =".$oidu."
             order by ltr_componente";
    $resul = $con->query($espe);
    $tem = 0;
    while($res = mssql_fetch_array($resul)){
        $paci = $res['nombres'];
        if($paci !== $tem){*/
           //echo '<table align="center" style="font-size:80%;overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:100%;margin:5% auto 0;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);">
                        /* <tr>
                            <td colspan="5" align="center" style="padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;">
                                <strong>'.$paci.'</strong>
                            </td>
                         </tr>
                         <tr>
                            <td style="font-size:70%;padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;">
                                <strong>SELLO</strong>
                            </td>
                            <td style="font-size:70%;padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;">
                                <strong>COMPONENTE</strong>
                            </td>
                            <td style="font-size:70%;padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;">
                                <strong>ESPECIALIDAD</strong>
                            </td>
                            <td style="font-size:70%;padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;">
                                <strong>FECHA</strong>
                            </td>
                            <td style="font-size:70%;padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;">
                                <strong>SIGNOS</strong>
                            </td>
                         </tr>';
        }
                   echo '<tr>
                            <td style="padding:10px 10px 10px; text-align:centert;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));">
                                '.$res['ltr_numSe'].'
                            </td>
                            <td style="padding:10px 10px 10px; text-align:centert;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));">
                                '.$res['ltr_componente'].'
                            </td>
                            <td style="padding:10px 10px 10px; text-align:centert;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));">
                                '.$res['GEEDESCRI'].'
                            </td>
                            <td style="padding:10px 10px 10px; text-align:centert;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));">
                                '.$res['ltr_fecha'].'
                            </td>
                            <td style="padding:10px 10px 10px; text-align:centert;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));">
                                '.$res['signos'].'
                            </td>
                         </tr>';
        
        $tem = $paci;
    }
            echo '</table>';
    $con->cerrarConexion();*/
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="../../../../Ginecobstetricia/vista/css/bootstrap-combined.min.css" rel="stylesheet">
         <!-- Librerias jquery y hojas de estilo para creacion  del calendario -->
        <script src="../../../../vista/reportes/js/jquery-1.5.2.js" type="text/javascript"></script>
     
        <style>
            .white {
                border-radius: 5px;
                color: #606060;
                border: solid 1px #b7b7b7;
                background: #fff;
                background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
                background: -moz-linear-gradient(top,  #fff,  #ededed);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
                padding: 4px 4px 4px;
                height: 30px;
                font-size: 13px;
            }
            .white:hover {
                background: #ededed;
                background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
                background: -moz-linear-gradient(top,  #fff,  #dcdcdc);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
            }
            .white:active {
                color: #999;
                background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
                background: -moz-linear-gradient(top,  #ededed,  #fff);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
            }
        </style>
        <script>
            function datos(){
                var oidu =$("#oidu").val();
                var ingreso =$("#ingreso").val();
                var f1 =$("#f1").val();
                var f2 =$("#f2").val();
                $.ajax({
                      async: true,
                     type:"POST",
                     datatype: "json",
                     contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                     url: "datosE2.php",
                     data:{oidu:oidu,ingreso:ingreso,f1:f1,f2:f2},
                     success: datos2,
                     timeout: 4000 
                   });
            }
            function datos2(datos){
                rpt = $.parseJSON(datos);
                    datos = $("#dato");
                    var resp = "";
                    resp += "<table style='font-size:90%;overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:100%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'>\
                                <tr>\
                                    <td colspan='2' style='padding:1px 1px 1px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                         Sello\
                                    </td>\
                                    <td style='padding:1px 1px 1px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb; '>\
                                         Componente\
                                    </td>\
                                    <td style='padding:1px 1px 1px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                         Especialidad\
                                    </td>\
                                    <td style='padding:1px 1px 1px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                         Fecha\
                                    </td>\
                                    <td style='padding:1px 1px 1px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                         Signos\
                                    </td>\
                                </tr>";
                    var con = 1;
                     for(dat in rpt){
                     resp += "<tr>\
                                    <td style='padding:10px 10px 10px; text-align:left;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                        "+ con +"\
                                    </td>\
                                     <td style='padding:10px 10px 10px; text-align:left;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                        "+ rpt[dat].ltr_numSe +"\
                                    </td>\
                                    <td style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                        "+ rpt[dat].ltr_componente +"\
                                    </td>\
                                    <td style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                        "+ rpt[dat].GEEDESCRI +"\
                                    </td>\
                                    <td style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                        "+ rpt[dat].ltr_fecha +"\
                                    </td>\
                                    <td style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));'>\
                                        "+ rpt[dat].signos +"\
                                    </td>\
                                   </td>\
                                 </tr>";
                                        document.getElementById("paciente").innerHTML=rpt[dat].nombres;
                   con++;
                   } 
                   resp += "</table>";
                   datos.append(resp);
            }
        </script>
    </head>
    <body onload="datos();">
        <div align="center" style="background-color:#e8eaeb;height:10%;width:100%;">
            <table style="width:100%; height:10%;" >
                <td align="center" width="88.3%">
                    <b><div style="padding:1.5%;" id="paciente"></div></b>
                </td>
            </table>

        </div>
        <div style='overflow-y: scroll;height:78%;'>
        <div id="dato">
            
        </div>
        </div>
        <div style="background-color:#e8eaeb;height:12%;width:100%;">
            <div style="padding:1%;">
                <table style="font-size:80%;width:100%">
                    <tr>
                        <td style="" align="right">
                            <input type="button" value="Cerrar" class="white" onclick="window.close();"/>
                            <input type="hidden" id="oidu" name="txtoidu" value="<?php echo$_REQUEST['oidu'] ?>" />
                            <input type="hidden" id="ingreso" name="txtingreso" value="<?php echo$_REQUEST['ingreso'] ?>" />
                            <input type="hidden" id="f1" name="txtf1" value="<?php echo$_REQUEST['f1'] ?>" />
                            <input type="hidden" id="f2" name="txtf2" value="<?php echo$_REQUEST['f2'] ?>" />
                        </td>
                    </tr>
                </table>
            </div>
         </div>
    </body>
</html>

